package com.zhongshengnetwork.rightbe.common;

import android.graphics.Color;

import com.zhongshengnetwork.rightbe.R;

public class AppThemeUtils {

    private static AppThemeUtils mInstance = null;

    public static final int DividerHeight = 10; //分割线高度

    public static final int SmallDividerHeight = 5; //分割线高度

    public static final String AppThemeKey = "AppThemeKey";

    private int appTheme = AppThemeConstant.NIGHT_APP_Theme;

    public static AppThemeUtils getInstance() {
        if(mInstance==null) {
            synchronized (AppStatusManager.class) {
                if(mInstance==null)
                    mInstance = new AppThemeUtils();
            }
        }
        return mInstance;
    }

    public static class AppThemeConstant {

        /**
         * 标准主题：浅绿
         */
        public static final int NORMAL_APP_Theme = 0;

        /**
         * 夜间模式主题
         */
        public static final int NIGHT_APP_Theme = 1;

    }

    //返回模式
    public int getAppTheme() {
        return appTheme;
    }

    //设置模式
    public void setAppTheme(int appTheme) {
        this.appTheme = appTheme;
    }

    //获取模式主题颜色
    public int getThemeColor(){

        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return Color.parseColor("#FF141414");
        }

        return Color.parseColor("#FF99CC00");

    }

    //获取模式主题颜色
    public String getThemeColorString(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return "#FF141414";
        }
        return "#FF99CC00";
    }

    //获取背景颜色
    public int getBackgroundColor(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return Color.parseColor("#FF000000");
        }

        return Color.parseColor("#FFF5F7FA");
    }

    //获取背景颜色
    public int getCardBackgroundColor(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return Color.parseColor("#FF000000");//141414
        }

        return Color.parseColor("#FFF5F7FA");
    }

    //获取卡片页面主题颜色
    public String getCardThemeColorString(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return "#FF000000";
        }

        return "#FFF5F7FA";
    }

    //获取背景颜色
    public String getBackgroundColorString(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return "#FF000000";
        }

        return "#FFF5F7FA";
    }

    //获取主颜色
    public int getMainColor(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return Color.parseColor("#FF141414");
        }

        return Color.parseColor("#FFFFFFFF");
    }

    //获取搜索框背景
    public int getSearchBgColor(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return Color.parseColor("#FF141414");
        }

        return Color.parseColor("#FF99CC00");
    }

    //获取主颜色
    public String getMainColorString(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return "#FF141414";
        }

        return "#FFFFFFFF";
    }

    //获取加载颜色
    public int getRefreshAccessColor(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return Color.parseColor("#FF99CC00");
        }

        return Color.parseColor("#FF99CC00");
    }

    //获取加载背景
    public int getRefreshBackgroundColor(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return Color.parseColor("#FF141414");
        }

        return Color.parseColor("#FFFFFFFF");
    }

    /********微句列表相关颜色********/
    //微句用户昵称颜色
    public int getUserNameColorOfWeiJu(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return Color.parseColor("#ffffffff");
        }

        return Color.parseColor("#FF000000");
    }
    //微句用户昵称颜色
    public String getUserNameColorStringOfWeiJu(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return "#ffffffff";
        }

        return "#FF000000";
    }

    //微句用户文字颜色
    public int getTextColorOfWeiJu(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return Color.parseColor("#ffffffff");
        }

        return Color.parseColor("#FF141414");//FF434A54
    }

    //微句用户文字颜色
    public String getTextColorStringOfWeiJu(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return "#ffffffff";
        }

        return "#FF141414";//FF434A54
    }

    //文字低量模式
    public int getLightTextColor(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return Color.parseColor("#ff757D88");
        }

        return Color.parseColor("#FFC0C0C0");
    }

    public int getSmallTextColor(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return Color.parseColor("#ff97a1ac");
        }

        return Color.parseColor("#FF656D78");
    }

    /********微句列表相关颜色********/


    /********图标********/
    //首页菜单图片
    public int getHomeMenuIcon(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return R.drawable.homemenu_white;
        }
        return R.drawable.homemenu;
    }

    //轮播背景图背景颜色
    public int getBannerBackground(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return R.drawable.banner_circle_shape_darkmode;
        }
        return R.drawable.banner_circle_shape;
    }

    //搜索框背景颜色
    public int getSearchBackground(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return R.drawable.search_round_shape_darkmode;
        }
        return R.drawable.search_round_shape;
    }

    //微句详情点赞背景
    public int getWeiJuLikeBackground(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return R.drawable.bg_round_light_darkmode;
        }
        return R.drawable.bg_round_light_gray;
    }

    //评论按钮颜色
    public int getCommentButtonBackground(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return R.drawable.round_darkmode_bg;
        }
        return R.drawable.round_gray_bg;
    }

    //已读消息颜色
    public int getReadMessageTextColor(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return Color.parseColor("#ff757D88");
        }

        return Color.parseColor("#FFC0C0C0");
    }

    //获取微纸条标签选中背景
    public int getWZTLabelSelectBackground(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return R.drawable.round_corner_rect_select_darkmode;
        }
        return R.drawable.round_corner_rect_select;
    }

    //图片加载默认图片
    public int getDefaultImageBg(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return R.drawable.defaultbgdarkmod;
        }
        return R.drawable.defaultbg;
    }

    //获取占位图片
    public int getDefaultBitmap(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return R.drawable.bitmap;
        }
        return R.drawable.wbitmap;
    }

    //绿色按钮背景
    public int getButtonBg(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return R.drawable.limitstyle_darkmode;
        }
        return R.drawable.limitstyle;
    }

    //分享背景
    public int getShareBg(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return R.drawable.darkmode_rect_round_coner;
        }
        return R.drawable.white_rect_round_corner;
    }

    //浅黄Button背景
    public int getCommonButtonBg(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return R.drawable.round_commoncolor_bg_darkmode;
        }
        return R.drawable.round_commoncolor_bg;
    }

    //浅绿Button背景
    public int getLightGreenButtonBg(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return R.drawable.round_green_bg_darkmode;
        }
        return R.drawable.round_green_bg;
    }

    public int getComsytleBg(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return R.drawable.comsytle_darkmode;
        }
        return R.drawable.comsytle;
    }

    //获取评论框背景
    public int getCommentBg(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return R.drawable.comment_darkmode_bg;
        }
        return R.drawable.comment_normal_bg;
    }

    //获取顶部导航栏背景颜色
    public int getTopBg(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return Color.parseColor("#FF141414");
        }

        return Color.parseColor("#FF99CC00");
    }

    //获取顶部导航字体颜色
    public int getTopTextSelectColor(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return Color.parseColor("#FF99CC00");
        }

        return Color.parseColor("#FFFFFFFF");
    }

    //获取导航未选择字体颜色
    public int getTopTextUnSelectColor(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return Color.parseColor("#ff97a1ac");
        }

        return Color.parseColor("#FFFFFFFF");//FFe5e7eA
    }

    //获取菜单字体颜色
    public int getLangTypeTextColor(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return Color.parseColor("#ff97a1ac");
        }

        return Color.parseColor("#FF656D78");
    }

    //获取菜单背景
    public int getLangTypeBgColor(){
        if (appTheme == AppThemeConstant.NIGHT_APP_Theme){
            return R.drawable.lang_type_darkmode_bg;
        }

        return R.drawable.lang_type_normalmode_bg;
    }

}
